package it.heima.xmy.Demo01;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

public class Practise03 {
    public static void main(String[] args) throws IOException {
        File file = new File("F:\\test.txt");
        //对源文件进行字符统计
        BufferedReader br = new BufferedReader(new FileReader(file));
        String s = null;
        while ((s = br.readLine()) != null) {
            //判断字符中是否存在tmd和Sb字符  不区分大小写
            if ((s.contains("TMD")||(s.contains("SB")))) {
                String tmd = s.replace("TMD", "***");
                String sb = tmd.replace("SB", "***");
                System.out.println(sb);
            }
        }
        br.close();
    }
}
